/*Replication Materials for "Powerless Conservatives or Powerless Findings?
PS
Stephen Utych*/

*Data source: 2016 ANES Time Series Study - available at electionstudies.org

/*Variable Recoding*/

*Dependent Variables

recode V161031 (2=1) (1=0) (3 4 5 6 7 8 -1 -8 -9 = .), gen(votetrump)
replace votetrump = 1 if V161027==2
replace votetrump = 0 if V161027==1

recode V161087 (-99 -88 = .), gen(ft_djt)


*Demographics
recode V161158x (-9 -8 = .), gen(repub)
recode V161003 (5=0) (4=1) (3=2) (2=3) (1=4), gen(pol_int)
recode V161342 (2=1) (1=0) (-9 3 = .), gen(female)
recode V161361x (-9 -5 = .), gen(income)
recode V161270 (-9 95 = .) (1 2 3 4 5 6 7 8 = 0) (9 90 = 1) (10 = 2) (11 12 = 3) (13 = 4) (14 15 16 = 5), gen(educ1)

recode V161126 (-8 -9 99 = .), gen(conserv)
recode V161241 (2=0) (-9 -8 = .), gen(relig_imp)
recode V161309 (2=0) (-9 -8 = .), gen(latinx)
recode V161310x (-9 = .) (1 3 4 5 6 = 0) (2=1), gen(black)
recode V161310x (-9 = .) (1 2 5 = 0) (3 4 6 = 1), gen(race_oth)

recode V161267c (-9 -8 = .), gen(byear)
gen age = 2016-byear

recode V161268 (1 2 = 1) (3 4 5 6 = 0) (-9=.), gen(married)
recode V161324 (0=0) (-9=.) (1 2 3 4 5 6 7 9 = 1), gen(under18)

*Auth

recode V162239 (2=1) (1=0) (3 -6 -7 -8 -9 =.), gen(a1)
recode V162240 (2=1) (1=0) (3 -6 -7 -8 -9 =.), gen(a2)
recode V162241 (1=1) (2=0) (3 -6 -7 -8 -9 =.), gen(a3)
recode V162242 (2=1) (1=0) (3 -6 -7 -8 -9 =.), gen(a4)

alpha a1-a4

egen acount = rownonmiss(a1-a4)
egen auth = rowtotal(a1-a4) if acount==4

*Egal

recode V162243 (5=0) (4=1) (3=2) (2=3) (1=4) (-6 -7 -8 -9 = .), gen(egal1)
recode V162244 (5=4) (4=3) (3=2) (2=1) (1=0) (-6 -7 -8 -9 = .), gen(egal2)
recode V162245 (5=4) (4=3) (3=2) (2=1) (1=0) (-6 -7 -8 -9 = .), gen(egal3)
recode V162246 (5=0) (4=1) (3=2) (2=3) (1=4) (-6 -7 -8 -9 = .), gen(egal4)

egen ecount = rownonmiss(egal1-egal4)
egen egal = rowtotal(egal1-egal4) if ecount==4


/*Independent Variables*/

recode V162362 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_women)
recode V162363 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_men)

recode V162360 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_w)
recode V162357 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_b)
recode V162358 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_h)


recode V162365 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_xtian)
recode V162364 (5=0) (4=1) (3=2) (2=3) (1=4) (-9 -7 -6 -5 = .), gen(disc_mus)


alpha disc_b disc_h disc_mus
egen disc_minc = rownonmiss(disc_b disc_h disc_mus)
egen disc_min = rowtotal(disc_b disc_h disc_mus) if disc_minc==3

alpha disc_xtian disc_w
egen disc_majc = rownonmiss(disc_xtian disc_w)
egen disc_maj = rowtotal(disc_xtian disc_w) if disc_majc==2


/*Regression replication*/

*Table 1

logit votetrump disc_women disc_men female age black latinx race_oth relig_imp pol_int repub conserv educ1 income married under18 auth egal [pweight=V160102]
reg ft_djt disc_women disc_men female age black latinx race_oth relig_imp pol_int repub conserv educ1 income married under18 auth egal [pweight=V160102]

*Table 2
logit votetrump disc_women disc_men disc_maj disc_min female age black latinx race_oth relig_imp pol_int repub conserv educ1 income married under18 auth egal [pweight=V160102]
reg ft_djt disc_women disc_men disc_maj disc_min female age black latinx race_oth relig_imp pol_int repub conserv educ1 income married under18 auth egal [pweight=V160102]


